package riceSystem.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import riceSystem.dao.DaoTemplateInterface;
import riceSystem.entity.BuyOrSellMessage;
import riceSystem.exception.RunException;
import riceSystem.service.ServiceTemplateInterface;
@Component("buyOrSellMessageService")
public class BuyOrSellMessageServiceImpl implements ServiceTemplateInterface<BuyOrSellMessage> {
	
	private DaoTemplateInterface<BuyOrSellMessage> buyOrSellMessageDao;
	
	public DaoTemplateInterface<BuyOrSellMessage> getBuyOrSellMessageDao() {
		return buyOrSellMessageDao;
	}
	@Resource(name="buyOrSellMessageDao")
	public void setBuyOrSellMessageDao(
			DaoTemplateInterface<BuyOrSellMessage> buyOrSellMessageDao) {
		this.buyOrSellMessageDao = buyOrSellMessageDao;
	}

	public void add(BuyOrSellMessage t) throws RunException {
		buyOrSellMessageDao.save(t);
	}

	public void removeById(long id) throws RunException {
		buyOrSellMessageDao.deleteById(id);
	}

	public void remove(BuyOrSellMessage t) throws RunException {
		buyOrSellMessageDao.delete(t);
	}

	public long update(BuyOrSellMessage t) throws RunException {
		return buyOrSellMessageDao.update(t);
	}

	public BuyOrSellMessage getById(long id) throws RunException {
		return buyOrSellMessageDao.loadById(id);
	}

	public List<BuyOrSellMessage> getAll() throws RunException {
		return buyOrSellMessageDao.loadAll();
	}

}
